-
Notifications
You must be signed in to change notification settings - Fork 919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added UTs for resourceregistry in pkg/generated #5417
Added UTs for resourceregistry in pkg/generated #5417
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #5417 +/- ##
==========================================
+ Coverage 30.12% 30.60% +0.48%
==========================================
Files 632 632
Lines 43936 43936
==========================================
+ Hits 13236 13448 +212
+ Misses 29742 29510 -232
- Partials 958 978 +20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@XiShanYongYe-Chang Please help review this MR too . |
Hey @yashpandey06 can you please update the file name from resourceregistry.go_test.go to resourceregistry_test.go. |
Apologies for that , fixed it |
|
we can move ahead with the review part |
Hi @yashpandey06 Can you help complete the title, and help squash the commits into one? |
/assign |
@XiShanYongYe-Chang sure doing it |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…ions Signed-off-by: Yash Pandey <[email protected]> Added UTs for resourceregistry for better coverage of critical conditions Signed-off-by: Yash Pandey <[email protected]>
3cb6b41
to
d9ffb9a
Compare
|
@XiShanYongYe-Chang , commits have been squashed , i think we can proceed 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @yashpandey06 the pkg/generated
is automatically generated by the code generation tool, so I'm not sure that adding tests for them is necessary. I looked at the kubernetes repository and they don't have test files either.
@XiShanYongYe-Chang so should i close this pr instead ? |
Let's close it first. |
Thanks for your feedback, closing it now . |
/kind feature
Fixes part of #5236
Description
This PR introduces comprehensive unit tests for the
ResourceRegistryLister
implementation in thev1alpha1
package. The tests cover the following scenarios:List Method:
ResourceRegistry
objects when the indexer is populated.Get Method:
NotFound
error is returned.ResourceRegistry
objects.These tests aim to ensure robustness and reliability of the
ResourceRegistryLister
functionality by covering both typical and edge cases.Changes
TestResourceRegistryLister_List
to test theList
method.TestResourceRegistryLister_Get
to test theGet
method, including error handling.mockIndexer
to simulate error scenarios.Does this PR introduce a user-facing change?:
NONE